package com.atguigu.jxc.service.impl;

import com.atguigu.jxc.dao.SupplierDao;
import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.Supplier;
import com.atguigu.jxc.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName SupplierServiceImpl
 * @Description
 * @Author junior
 * @Date 2021/9/25 16:51
 */
@Service
public class SupplierServiceImpl implements SupplierService {
    @Autowired
    private SupplierDao supplierDao;

    @Override
    public Map<String, Object> list(Integer page, Integer rows, String supplierName) {
        List<Supplier> supplierList = supplierDao.list(page - 1, rows, supplierName);
        Map<String, Object> map = new HashMap<>();
        map.put("total", supplierList.size());
        map.put("rows", supplierList);
        return map;
    }
}
